const { model, Sequelize } = require('../../core/model.js');

const itemsModel = model.define('items', {
    item_name: {
        type: Sequelize.STRING(100),
        unique: 'item_nameUq',
    },
    parent_id: {
        type: Sequelize.INTEGER
    },
    status: {
        type: Sequelize.ENUM('1', '0'),
    },
    sort: Sequelize.DATE,
    ctime: Sequelize.DATE,
    mtime: Sequelize.DATE,
}, {
        createdAt: 'ctime',
        updatedAt: 'mtime',
    })

itemsModel.sync({
    // force: true 
})

module.exports = {
    itemsModel,
    model,
    Op: Sequelize.Op
};